<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/site.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/mystyle.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>
	<div id="header">
		<div>
			<div class="logo">
				<?php echo CHtml::link(CHtml::encode(Yii::app()->name), array('/site/index')); ?>
			</div>

			<div id="navigation">
				<?php $this->widget('zii.widgets.CMenu',array(
					'items' => array(
						array('label' => 'Home', 'url' => array('site/index')),
						array('label' => 'Jokes', 'url' => array('/jokes')),
						array('label' => 'Crosswords', 'url' => array('/crosswords')),
//						array('url' => Yii::app()->getModule('user')->loginUrl, 'label' => Yii::app()->getModule('user')->t("Login"), 'visible' => Yii::app()->user->isGuest),
//						array('url' => Yii::app()->getModule('user')->registrationUrl, 'label' => Yii::app()->getModule('user')->t("Register"), 'visible' => Yii::app()->user->isGuest),
//						array('url' => Yii::app()->getModule('user')->profileUrl, 'label' => Yii::app()->getModule('user')->t("Profile"), 'visible' => !Yii::app()->user->isGuest),
//						array('url' => Yii::app()->getModule('user')->logoutUrl, 'label' => Yii::app()->getModule('user')->t("Logout") . ' (' . Yii::app()->user->name . ')', 'visible' => !Yii::app()->user->isGuest),
					),
				)); ?>
			</div><!-- mainmenu -->
			<div style="float: right;">
				<?php if(Yii::app()->user->isGuest){?>
					<?php echo CHtml::link(CHtml::encode(Yii::app()->getModule('user')->t("Login")), array(Yii::app()->getModule('user')->loginUrl[0])); ?>
					<?php echo CHtml::link(CHtml::encode(Yii::app()->getModule('user')->t("Register")), array(Yii::app()->getModule('user')->registrationUrl[0])); ?>
				<?php } else { ?>
					<?php echo CHtml::link(CHtml::encode(Yii::app()->getModule('user')->t("Profile")), array(Yii::app()->getModule('user')->profileUrl[0])); ?>
					<?php echo CHtml::link(CHtml::encode(Yii::app()->getModule('user')->t("Logout"). ' (' . Yii::app()->user->name . ')'), array(Yii::app()->getModule('user')->logoutUrl[0])); ?>
				<?php } ?>
			</div>
		</div>
	</div><!-- header -->
<!--
	<div id="adbox">
		<div class="clearfix">

		</div>
	</div>
-->
	<div id="contents">
		<div id="tagline" class="clearfix">
			<?php echo $content; ?>
		</div>
	</div>


	<div id="footer">
		<div class="clearfix">
			<div style="float:left;">
				Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
			All Rights Reserved.<br/>
			<?php echo Yii::powered(); ?>
			</div>
			<div style="float: right;">
				<?php $this->widget('zii.widgets.CMenu',array(
					'items' => array(
						array('label' => 'About', 'url' => array('/site/page', 'view' => 'about')),
						array('label' => 'Contact', 'url' => array('/site/contact')),
					),
				)); ?>
			</div>
		</div>
	</div>
</body>
</html>
